<?php
/**
 * Created by PhpStorm.
 * User: beijingwhg
 * Date: 2017/5/12
 * Time: 上午9:20
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\SoftDeletes;

class NotificationModel extends Model
{
    use SoftDeletes;

    protected $primaryKey = 'not_id';

    protected $table = 'notification';

    protected $fillable = [
        'type', 'content', 'id', 'from', 'to', 'status'
    ];

    protected $dates = [
        'created_at', 'updated_at'
    ];

    public function getCreatedAtAttribute($data){
        return Carbon::createFromTimestamp(strtotime($data))->diffForHumans();
    }
}